<?php
require "../common/user_online.php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>EbookAZ</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<?php require "../components/head.php" ?>
</head>
<body onload="MakeCurrentPage(1)">
<div id="container">
	<?php require "../components/admin_menu.php" ?>
	<?php require "../components/admin_header.php" ?>
	<div id="content">
		<?php require "../components/content_left.php"?>
		<div id="content_right">
		<?php		
		$arrOrder = array("Title"=>"Tên file", "UpdateDate"=>"Ngày upload", "DownloadCount"=>"Lượt download", "Mana"=>"Mana", "RatingPoint"=>"Đánh giá", "Size"=>"Kích thước");
		$arrSort = array("asc"=>"Tăng dần", "desc"=>"Giảm dần");
		echo "<label>Sắp xếp theo</label>"; 
		echo "<select id='selectOrder'>";
		foreach($arrOrder as $key=>$value)
		{
			if($key==$_GET['orderby'])
				echo "<option selected value='$key'>$value</option>";
			else
				echo "<option value='$key'>$value</option>";
		}
		echo "</select>";
		echo "<select id='selectSort'>";
		foreach($arrSort as $key=>$value)
		{
			if($key==$_GET['sort'])
				echo "<option selected value='$key'>$value</option>";
			else
				echo "<option value='$key'>$value</option>";
		}
		$field = $_REQUEST['field'];
		$category = $_REQUEST['category'];
		echo "<input type='button' onClick='SortBook($field, $category, 1)' value='OK'></input>";
		echo "<div id='divBook'>";
		
		require "getbookbycategory.php";
		echo "</div>";
		?>		
		</div>
	</div>
	<?php require "../components/footer.php" ?>
</div>
</body>
</html>
